package com.yongbao.controller.admin;

import com.yongbao.common.PageInfo;
import com.yongbao.common.WebResponse;
import com.yongbao.common.annotation.WebAccess;
import com.yongbao.model.request.DishOrderSubRequest;
import com.yongbao.model.vo.DishOrderSubVO;
import com.yongbao.service.DishOrderSubService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zhanghong
 */
@RestController
@RequestMapping("/admin/dishOrderSub")
@Api(value = "【管理端】订单从模块", tags = {"【管理端】订单从模块"})
public class AdminDishOrderSubController {

    @Autowired
    private DishOrderSubService dishOrderSubService;

    //@WebAccess(login = true)
    //@ApiOperation(value = "根据主键查询", httpMethod = "POST")
    //@ApiResponses(value = {@ApiResponse(code = 200, message = "success")})
    //@PostMapping("/get/{id}")
    //public WebResponse<DishOrderSubVO> getByKey(HttpServletRequest request, @PathVariable("id") long id) {
    //    return WebResponse.build(dishOrderSubService.getByKey(id));
    //}

    @WebAccess(login = true)
    @ApiOperation("分页查询")
    @PostMapping("/pageQuery")
    public WebResponse<PageInfo<DishOrderSubVO>> pageQuery(@RequestBody DishOrderSubRequest request) {
        return WebResponse.build(dishOrderSubService.pageQuery(request));
    }

    //@WebAccess(login = true)
    //@ApiOperation("列表查询")
    //@PostMapping("/listQuery")
    //public WebResponse<List<DishOrderSubVO>> listQuery(@RequestBody DishOrderSubRequest request) {
    //    return WebResponse.build(dishOrderSubService.listQuery(request));
    //}
    //
    //@WebAccess(login = true)
    //@ApiOperation("新增")
    //@PostMapping("/add")
    //public WebResponse<Boolean> add(@Valid @RequestBody DishOrderSubRequest request) {
    //    return WebResponse.build(dishOrderSubService.add(request));
    //}
    //
    //@WebAccess(login = true)
    //@ApiOperation("修改")
    //@PostMapping("/update")
    //public WebResponse<Boolean> updateByKey(@Valid @RequestBody DishOrderSubRequest request) {
    //    return WebResponse.build(dishOrderSubService.updateByKey(request));
    //}
    //
    //@WebAccess(login = true)
    //@ApiOperation("删除")
    //@PostMapping("/delete")
    //public WebResponse<Boolean> deleteByKey(@RequestParam String ids) {
    //    return WebResponse.build(dishOrderSubService.deleteByIds(id));
    //}
}
